<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Feature Detection</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Feature Detection<div class="ingroups"><a class="el" href="../../d7/dbd/group__imgproc.html">Image Processing</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html">cv::LineSegmentDetector</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Line segment detector class.  <a href="../../db/d73/classcv_1_1LineSegmentDetector.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga073687a5b96ac7a3ab5802eb5510fe65"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga073687a5b96ac7a3ab5802eb5510fe65">cv::HoughModes</a> { <br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aeb97ba90cb7ffac9d55c71290aa258cc">cv::HOUGH_STANDARD</a> = 0, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65a2af8751122d7a6df8ef14dbc0799f76c">cv::HOUGH_PROBABILISTIC</a> = 1, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65a0f81016a60d190b6987386a0b4b478e4">cv::HOUGH_MULTI_SCALE</a> = 2, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d">cv::HOUGH_GRADIENT</a> = 3, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad">cv::HOUGH_GRADIENT_ALT</a> = 4
<br/>
 }<tr class="memdesc:ga073687a5b96ac7a3ab5802eb5510fe65"><td class="mdescLeft"> </td><td class="mdescRight">Variants of a Hough transform.  <a href="../../dd/d1a/group__imgproc__feature.html#ga073687a5b96ac7a3ab5802eb5510fe65">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:ga073687a5b96ac7a3ab5802eb5510fe65"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad092a7362b8afb8a905238a41898d98c"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#gad092a7362b8afb8a905238a41898d98c">cv::LineSegmentDetectorModes</a> { <br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ggad092a7362b8afb8a905238a41898d98ca0114485ddcbb3d913b6d899a8697e30e">cv::LSD_REFINE_NONE</a> = 0, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ggad092a7362b8afb8a905238a41898d98cade4b0da3a52bc9765f08255f041facb4">cv::LSD_REFINE_STD</a> = 1, 
<br/>
  <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ggad092a7362b8afb8a905238a41898d98ca88d573b707a6f7bbdeae166247cd8c15">cv::LSD_REFINE_ADV</a> = 2
<br/>
 }<tr class="memdesc:gad092a7362b8afb8a905238a41898d98c"><td class="mdescLeft"> </td><td class="mdescRight">Variants of Line Segment Detector.  <a href="../../dd/d1a/group__imgproc__feature.html#gad092a7362b8afb8a905238a41898d98c">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gad092a7362b8afb8a905238a41898d98c"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga04723e007ed888ddf11d9ba04e2232de"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de">cv::Canny</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false)</td></tr>
<tr class="memdesc:ga04723e007ed888ddf11d9ba04e2232de"><td class="mdescLeft"> </td><td class="mdescRight">Finds edges in an image using the Canny algorithm <a class="el" href="../../d0/de3/citelist.html#CITEREF_Canny86">[41]</a> .  <a href="../../dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de">More...</a><br/></td></tr>
<tr class="separator:ga04723e007ed888ddf11d9ba04e2232de"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2a671611e104c093843d7b7fc46d24af"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga2a671611e104c093843d7b7fc46d24af">cv::Canny</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> dx, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> dy, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> edges, double threshold1, double threshold2, bool L2gradient=false)</td></tr>
<tr class="separator:ga2a671611e104c093843d7b7fc46d24af"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4055896d9ef77dd3cacf2c5f60e13f1c"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga4055896d9ef77dd3cacf2c5f60e13f1c">cv::cornerEigenValsAndVecs</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int blockSize, int ksize, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga4055896d9ef77dd3cacf2c5f60e13f1c"><td class="mdescLeft"> </td><td class="mdescRight">Calculates eigenvalues and eigenvectors of image blocks for corner detection.  <a href="../../dd/d1a/group__imgproc__feature.html#ga4055896d9ef77dd3cacf2c5f60e13f1c">More...</a><br/></td></tr>
<tr class="separator:ga4055896d9ef77dd3cacf2c5f60e13f1c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac1fc3598018010880e370e2f709b4345"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345">cv::cornerHarris</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int blockSize, int ksize, double k, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gac1fc3598018010880e370e2f709b4345"><td class="mdescLeft"> </td><td class="mdescRight">Harris corner detector.  <a href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345">More...</a><br/></td></tr>
<tr class="separator:gac1fc3598018010880e370e2f709b4345"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3dbce297c1feb859ee36707e1003e0a8"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8">cv::cornerMinEigenVal</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int blockSize, int ksize=3, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga3dbce297c1feb859ee36707e1003e0a8"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the minimal eigenvalue of gradient matrices for corner detection.  <a href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8">More...</a><br/></td></tr>
<tr class="separator:ga3dbce297c1feb859ee36707e1003e0a8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga354e0d7c86d0d9da75de9b9701a9a87e"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e">cv::cornerSubPix</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> corners, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> winSize, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> zeroZone, <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> criteria)</td></tr>
<tr class="memdesc:ga354e0d7c86d0d9da75de9b9701a9a87e"><td class="mdescLeft"> </td><td class="mdescRight">Refines the corner locations.  <a href="../../dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e">More...</a><br/></td></tr>
<tr class="separator:ga354e0d7c86d0d9da75de9b9701a9a87e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6b2ad2353c337c42551b521a73eeae7d"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html">LineSegmentDetector</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga6b2ad2353c337c42551b521a73eeae7d">cv::createLineSegmentDetector</a> (int _refine=<a class="el" href="../../dd/d1a/group__imgproc__feature.html#ggad092a7362b8afb8a905238a41898d98cade4b0da3a52bc9765f08255f041facb4">LSD_REFINE_STD</a>, double _scale=0.8, double _sigma_scale=0.6, double _quant=2.0, double _ang_th=22.5, double _log_eps=0, double _density_th=0.7, int _n_bins=1024)</td></tr>
<tr class="memdesc:ga6b2ad2353c337c42551b521a73eeae7d"><td class="mdescLeft"> </td><td class="mdescRight">Creates a smart pointer to a <a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html" title="Line segment detector class. ">LineSegmentDetector</a> object and initializes it.  <a href="../../dd/d1a/group__imgproc__feature.html#ga6b2ad2353c337c42551b521a73eeae7d">More...</a><br/></td></tr>
<tr class="separator:ga6b2ad2353c337c42551b521a73eeae7d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1d6bb77486c8f92d79c8793ad995d541"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541">cv::goodFeaturesToTrack</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> corners, int maxCorners, double qualityLevel, double minDistance, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), int blockSize=3, bool useHarrisDetector=false, double k=0.04)</td></tr>
<tr class="memdesc:ga1d6bb77486c8f92d79c8793ad995d541"><td class="mdescLeft"> </td><td class="mdescRight">Determines strong corners on an image.  <a href="../../dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541">More...</a><br/></td></tr>
<tr class="separator:ga1d6bb77486c8f92d79c8793ad995d541"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaaf8a051fb13cab1eba5e2149f75e902f"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#gaaf8a051fb13cab1eba5e2149f75e902f">cv::goodFeaturesToTrack</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> corners, int maxCorners, double qualityLevel, double minDistance, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask, int blockSize, int gradientSize, bool useHarrisDetector=false, double k=0.04)</td></tr>
<tr class="separator:gaaf8a051fb13cab1eba5e2149f75e902f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac52aa0fc91b1fd4a5f5a8c7d80e04bd4"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac52aa0fc91b1fd4a5f5a8c7d80e04bd4">cv::goodFeaturesToTrack</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> corners, int maxCorners, double qualityLevel, double minDistance, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> mask, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> cornersQuality, int blockSize=3, int gradientSize=3, bool useHarrisDetector=false, double k=0.04)</td></tr>
<tr class="memdesc:gac52aa0fc91b1fd4a5f5a8c7d80e04bd4"><td class="mdescLeft"> </td><td class="mdescRight">Same as above, but returns also quality measure of the detected corners.  <a href="../../dd/d1a/group__imgproc__feature.html#gac52aa0fc91b1fd4a5f5a8c7d80e04bd4">More...</a><br/></td></tr>
<tr class="separator:gac52aa0fc91b1fd4a5f5a8c7d80e04bd4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga47849c3be0d0406ad3ca45db65a25d2d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d">cv::HoughCircles</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0)</td></tr>
<tr class="memdesc:ga47849c3be0d0406ad3ca45db65a25d2d"><td class="mdescLeft"> </td><td class="mdescRight">Finds circles in a grayscale image using the Hough transform.  <a href="../../dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d">More...</a><br/></td></tr>
<tr class="separator:ga47849c3be0d0406ad3ca45db65a25d2d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga46b4e588934f6c8dfd509cc6e0e4545a"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a">cv::HoughLines</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> lines, double rho, double theta, int <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">threshold</a>, double srn=0, double stn=0, double min_theta=0, double max_theta=<a class="el" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>)</td></tr>
<tr class="memdesc:ga46b4e588934f6c8dfd509cc6e0e4545a"><td class="mdescLeft"> </td><td class="mdescRight">Finds lines in a binary image using the standard Hough transform.  <a href="../../dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a">More...</a><br/></td></tr>
<tr class="separator:ga46b4e588934f6c8dfd509cc6e0e4545a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8618180a5948286384e3b7ca02f6feeb"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb">cv::HoughLinesP</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> lines, double rho, double theta, int <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">threshold</a>, double minLineLength=0, double maxLineGap=0)</td></tr>
<tr class="memdesc:ga8618180a5948286384e3b7ca02f6feeb"><td class="mdescLeft"> </td><td class="mdescRight">Finds line segments in a binary image using the probabilistic Hough transform.  <a href="../../dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb">More...</a><br/></td></tr>
<tr class="separator:ga8618180a5948286384e3b7ca02f6feeb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga2858ef61b4e47d1919facac2152a160e"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga2858ef61b4e47d1919facac2152a160e">cv::HoughLinesPointSet</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> _point, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> _lines, int lines_max, int <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">threshold</a>, double min_rho, double max_rho, double rho_step, double min_theta, double max_theta, double theta_step)</td></tr>
<tr class="memdesc:ga2858ef61b4e47d1919facac2152a160e"><td class="mdescLeft"> </td><td class="mdescRight">Finds lines in a set of points using the standard Hough transform.  <a href="../../dd/d1a/group__imgproc__feature.html#ga2858ef61b4e47d1919facac2152a160e">More...</a><br/></td></tr>
<tr class="separator:ga2858ef61b4e47d1919facac2152a160e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa819f39b5c994871774081803ae22586"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1a/group__imgproc__feature.html#gaa819f39b5c994871774081803ae22586">cv::preCornerDetect</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ksize, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gaa819f39b5c994871774081803ae22586"><td class="mdescLeft"> </td><td class="mdescRight">Calculates a feature map for corner detection.  <a href="../../dd/d1a/group__imgproc__feature.html#gaa819f39b5c994871774081803ae22586">More...</a><br/></td></tr>
<tr class="separator:gaa819f39b5c994871774081803ae22586"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga073687a5b96ac7a3ab5802eb5510fe65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga073687a5b96ac7a3ab5802eb5510fe65">◆ </a></span>HoughModes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga073687a5b96ac7a3ab5802eb5510fe65">cv::HoughModes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Variants of a Hough transform. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga073687a5b96ac7a3ab5802eb5510fe65aeb97ba90cb7ffac9d55c71290aa258cc"></a>HOUGH_STANDARD <div class="python_language">Python: cv.HOUGH_STANDARD</div></td><td class="fielddoc"><p>classical or standard Hough transform. Every line is represented by two floating-point numbers \((\rho, \theta)\) , where \(\rho\) is a distance between (0,0) point and the line, and \(\theta\) is the angle between x-axis and the normal to the line. Thus, the matrix must be (the created sequence will be) of CV_32FC2 type </p>
</td></tr>
<tr><td class="fieldname"><a id="gga073687a5b96ac7a3ab5802eb5510fe65a2af8751122d7a6df8ef14dbc0799f76c"></a>HOUGH_PROBABILISTIC <div class="python_language">Python: cv.HOUGH_PROBABILISTIC</div></td><td class="fielddoc"><p>probabilistic Hough transform (more efficient in case if the picture contains a few long linear segments). It returns line segments rather than the whole line. Each segment is represented by starting and ending points, and the matrix must be (the created sequence will be) of the CV_32SC4 type. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga073687a5b96ac7a3ab5802eb5510fe65a0f81016a60d190b6987386a0b4b478e4"></a>HOUGH_MULTI_SCALE <div class="python_language">Python: cv.HOUGH_MULTI_SCALE</div></td><td class="fielddoc"><p>multi-scale variant of the classical Hough transform. The lines are encoded the same way as HOUGH_STANDARD. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d"></a>HOUGH_GRADIENT <div class="python_language">Python: cv.HOUGH_GRADIENT</div></td><td class="fielddoc"><p>basically <em>21HT</em>, described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Yuen90">[287]</a> </p>
</td></tr>
<tr><td class="fieldname"><a id="gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad"></a>HOUGH_GRADIENT_ALT <div class="python_language">Python: cv.HOUGH_GRADIENT_ALT</div></td><td class="fielddoc"><p>variation of HOUGH_GRADIENT to get better accuracy </p>
</td></tr>
</table>
</div>
</div>
<a id="gad092a7362b8afb8a905238a41898d98c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad092a7362b8afb8a905238a41898d98c">◆ </a></span>LineSegmentDetectorModes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gad092a7362b8afb8a905238a41898d98c">cv::LineSegmentDetectorModes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Variants of Line Segment Detector. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggad092a7362b8afb8a905238a41898d98ca0114485ddcbb3d913b6d899a8697e30e"></a>LSD_REFINE_NONE <div class="python_language">Python: cv.LSD_REFINE_NONE</div></td><td class="fielddoc"><p>No refinement applied. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggad092a7362b8afb8a905238a41898d98cade4b0da3a52bc9765f08255f041facb4"></a>LSD_REFINE_STD <div class="python_language">Python: cv.LSD_REFINE_STD</div></td><td class="fielddoc"><p>Standard refinement is applied. E.g. breaking arches into smaller straighter line approximations. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggad092a7362b8afb8a905238a41898d98ca88d573b707a6f7bbdeae166247cd8c15"></a>LSD_REFINE_ADV <div class="python_language">Python: cv.LSD_REFINE_ADV</div></td><td class="fielddoc"><p>Advanced refinement. Number of false alarms is calculated, lines are refined through increase of precision, decrement in size, etc. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga04723e007ed888ddf11d9ba04e2232de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga04723e007ed888ddf11d9ba04e2232de">◆ </a></span>Canny() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::Canny </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>apertureSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>L2gradient</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>edges</td><td>=</td><td>cv.Canny(</td><td class="paramname">image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>edges</td><td>=</td><td>cv.Canny(</td><td class="paramname">dx, dy, threshold1, threshold2[, edges[, L2gradient]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Finds edges in an image using the Canny algorithm <a class="el" href="../../d0/de3/citelist.html#CITEREF_Canny86">[41]</a> . </p>
<p>The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See <a href="http://en.wikipedia.org/wiki/Canny_edge_detector">http://en.wikipedia.org/wiki/Canny_edge_detector</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>8-bit input image. </td></tr>
    <tr><td class="paramname">edges</td><td>output edge map; single channels 8-bit image, which has the same size as image . </td></tr>
    <tr><td class="paramname">threshold1</td><td>first threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">threshold2</td><td>second threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">apertureSize</td><td>aperture size for the Sobel operator. </td></tr>
    <tr><td class="paramname">L2gradient</td><td>a flag, indicating whether a more accurate \(L_2\) norm \(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default \(L_1\) norm \(=|dI/dx|+|dI/dy|\) is enough ( L2gradient=false ). </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d56/samples_2cpp_2edge_8cpp-example.html#a3">samples/cpp/edge.cpp</a>, <a class="el" href="../../db/d00/samples_2cpp_2squares_8cpp-example.html#a14">samples/cpp/squares.cpp</a>, <a class="el" href="../../d5/df9/samples_2cpp_2tutorial_code_2ImgTrans_2houghlines_8cpp-example.html#a5">samples/cpp/tutorial_code/ImgTrans/houghlines.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a13">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga2a671611e104c093843d7b7fc46d24af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2a671611e104c093843d7b7fc46d24af">◆ </a></span>Canny() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::Canny </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>dx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>dy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>L2gradient</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>edges</td><td>=</td><td>cv.Canny(</td><td class="paramname">image, threshold1, threshold2[, edges[, apertureSize[, L2gradient]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>edges</td><td>=</td><td>cv.Canny(</td><td class="paramname">dx, dy, threshold1, threshold2[, edges[, L2gradient]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.</p>
<p>Finds edges in an image using the Canny algorithm with custom image gradient.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dx</td><td>16-bit x derivative of input image (CV_16SC1 or CV_16SC3). </td></tr>
    <tr><td class="paramname">dy</td><td>16-bit y derivative of input image (same type as dx). </td></tr>
    <tr><td class="paramname">edges</td><td>output edge map; single channels 8-bit image, which has the same size as image . </td></tr>
    <tr><td class="paramname">threshold1</td><td>first threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">threshold2</td><td>second threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">L2gradient</td><td>a flag, indicating whether a more accurate \(L_2\) norm \(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default \(L_1\) norm \(=|dI/dx|+|dI/dy|\) is enough ( L2gradient=false ). </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga4055896d9ef77dd3cacf2c5f60e13f1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4055896d9ef77dd3cacf2c5f60e13f1c">◆ </a></span>cornerEigenValsAndVecs()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cornerEigenValsAndVecs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.cornerEigenValsAndVecs(</td><td class="paramname">src, blockSize, ksize[, dst[, borderType]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates eigenvalues and eigenvectors of image blocks for corner detection. </p>
<p>For every pixel \(p\) , the function cornerEigenValsAndVecs considers a blockSize \(\times\) blockSize neighborhood \(S(p)\) . It calculates the covariation matrix of derivatives over the neighborhood as:</p>
<p class="formulaDsp">
\[M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 &amp; \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy &amp; \sum _{S(p)}(dI/dy)^2 \end{bmatrix}\]
</p>
<p>where the derivatives are computed using the Sobel operator.</p>
<p>After that, it finds eigenvectors and eigenvalues of \(M\) and stores them in the destination image as \((\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)\) where</p>
<ul>
<li>\(\lambda_1, \lambda_2\) are the non-sorted eigenvalues of \(M\)</li>
<li>\(x_1, y_1\) are the eigenvectors corresponding to \(\lambda_1\)</li>
<li>\(x_2, y_2\) are the eigenvectors corresponding to \(\lambda_2\)</li>
</ul>
<p>The output of the function can be used for robust edge or corner detection.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Input single-channel 8-bit or floating-point image. </td></tr>
    <tr><td class="paramname">dst</td><td>Image to store the results. It has the same size as src and the type <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga56e67b727727f2f9b73a4b62f0c4b2b5">CV_32FC(6)</a> . </td></tr>
    <tr><td class="paramname">blockSize</td><td>Neighborhood size (see details below). </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture parameter for the Sobel operator. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method. See <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a>, <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a>, <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gaa819f39b5c994871774081803ae22586" title="Calculates a feature map for corner detection. ">preCornerDetect</a> </dd></dl>
</div>
</div>
<a id="gac1fc3598018010880e370e2f709b4345"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac1fc3598018010880e370e2f709b4345">◆ </a></span>cornerHarris()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cornerHarris </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.cornerHarris(</td><td class="paramname">src, blockSize, ksize, k[, dst[, borderType]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Harris corner detector. </p>
<p>The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and cornerEigenValsAndVecs , for each pixel \((x, y)\) it calculates a \(2\times2\) gradient covariance matrix \(M^{(x,y)}\) over a \(\texttt{blockSize} \times \texttt{blockSize}\) neighborhood. Then, it computes the following characteristic:</p>
<p class="formulaDsp">
\[\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2\]
</p>
<p>Corners in the image can be found as the local maxima of this response map.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Input single-channel 8-bit or floating-point image. </td></tr>
    <tr><td class="paramname">dst</td><td>Image to store the Harris detector responses. It has the type CV_32FC1 and the same size as src . </td></tr>
    <tr><td class="paramname">blockSize</td><td>Neighborhood size (see the details on <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga4055896d9ef77dd3cacf2c5f60e13f1c" title="Calculates eigenvalues and eigenvectors of image blocks for corner detection. ">cornerEigenValsAndVecs</a> ). </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture parameter for the Sobel operator. </td></tr>
    <tr><td class="paramname">k</td><td>Harris detector free parameter. See the formula above. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method. See <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga3dbce297c1feb859ee36707e1003e0a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3dbce297c1feb859ee36707e1003e0a8">◆ </a></span>cornerMinEigenVal()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cornerMinEigenVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.cornerMinEigenVal(</td><td class="paramname">src, blockSize[, dst[, ksize[, borderType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the minimal eigenvalue of gradient matrices for corner detection. </p>
<p>The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal eigenvalue of the covariance matrix of derivatives, that is, \(\min(\lambda_1, \lambda_2)\) in terms of the formulae in the cornerEigenValsAndVecs description.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Input single-channel 8-bit or floating-point image. </td></tr>
    <tr><td class="paramname">dst</td><td>Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as src . </td></tr>
    <tr><td class="paramname">blockSize</td><td>Neighborhood size (see the details on <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga4055896d9ef77dd3cacf2c5f60e13f1c" title="Calculates eigenvalues and eigenvectors of image blocks for corner detection. ">cornerEigenValsAndVecs</a> ). </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture parameter for the Sobel operator. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method. See <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga354e0d7c86d0d9da75de9b9701a9a87e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga354e0d7c86d0d9da75de9b9701a9a87e">◆ </a></span>cornerSubPix()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cornerSubPix </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> </td>
          <td class="paramname"><em>corners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>winSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>zeroZone</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> </td>
          <td class="paramname"><em>criteria</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.cornerSubPix(</td><td class="paramname">image, corners, winSize, zeroZone, criteria</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Refines the corner locations. </p>
<p>The function iterates to find the sub-pixel accurate location of corners or radial saddle points as described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_forstner1987fast">[81]</a>, and as shown on the figure below.</p>
<div class="image">
<img alt="cornersubpix.png" src="../../cornersubpix.png"/>
<div class="caption">
image</div></div>
<p> Sub-pixel accurate corner locator is based on the observation that every vector from the center \(q\) to a point \(p\) located within a neighborhood of \(q\) is orthogonal to the image gradient at \(p\) subject to image and measurement noise. Consider the expression:</p>
<p class="formulaDsp">
\[\epsilon _i = {DI_{p_i}}^T \cdot (q - p_i)\]
</p>
<p>where \({DI_{p_i}}\) is an image gradient at one of the points \(p_i\) in a neighborhood of \(q\) . The value of \(q\) is to be found so that \(\epsilon_i\) is minimized. A system of equations may be set up with \(\epsilon_i\) set to zero:</p>
<p class="formulaDsp">
\[\sum _i(DI_{p_i} \cdot {DI_{p_i}}^T) \cdot q - \sum _i(DI_{p_i} \cdot {DI_{p_i}}^T \cdot p_i)\]
</p>
<p>where the gradients are summed within a neighborhood ("search window") of \(q\) . Calling the first gradient term \(G\) and the second gradient term \(b\) gives:</p>
<p class="formulaDsp">
\[q = G^{-1} \cdot b\]
</p>
<p>The algorithm sets the center of the neighborhood window at this new center \(q\) and then iterates until the center stays within a set threshold.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>Input single-channel, 8-bit or float image. </td></tr>
    <tr><td class="paramname">corners</td><td>Initial coordinates of the input corners and refined coordinates provided for output. </td></tr>
    <tr><td class="paramname">winSize</td><td>Half of the side length of the search window. For example, if winSize=Size(5,5) , then a \((5*2+1) \times (5*2+1) = 11 \times 11\) search window is used. </td></tr>
    <tr><td class="paramname">zeroZone</td><td>Half of the size of the dead region in the middle of the search zone over which the summation in the formula below is not done. It is used sometimes to avoid possible singularities of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such a size. </td></tr>
    <tr><td class="paramname">criteria</td><td>Criteria for termination of the iterative process of corner refinement. That is, the process of corner position refinement stops either after criteria.maxCount iterations or when the corner position moves by less than criteria.epsilon on some iteration. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d2/d1d/samples_2cpp_2lkdemo_8cpp-example.html#a21">samples/cpp/lkdemo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga6b2ad2353c337c42551b521a73eeae7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6b2ad2353c337c42551b521a73eeae7d">◆ </a></span>createLineSegmentDetector()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html">LineSegmentDetector</a>&gt; cv::createLineSegmentDetector </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>_refine</em> = <code><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ggad092a7362b8afb8a905238a41898d98cade4b0da3a52bc9765f08255f041facb4">LSD_REFINE_STD</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_scale</em> = <code>0.8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_sigma_scale</em> = <code>0.6</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_quant</em> = <code>2.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_ang_th</em> = <code>22.5</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_log_eps</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_density_th</em> = <code>0.7</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>_n_bins</em> = <code>1024</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.createLineSegmentDetector(</td><td class="paramname">[, _refine[, _scale[, _sigma_scale[, _quant[, _ang_th[, _log_eps[, _density_th[, _n_bins]]]]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Creates a smart pointer to a <a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html" title="Line segment detector class. ">LineSegmentDetector</a> object and initializes it. </p>
<p>The <a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html" title="Line segment detector class. ">LineSegmentDetector</a> algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">_refine</td><td>The way found lines will be refined, see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gad092a7362b8afb8a905238a41898d98c" title="Variants of Line Segment Detector. ">LineSegmentDetectorModes</a> </td></tr>
    <tr><td class="paramname">_scale</td><td>The scale of the image that will be used to find the lines. <a class="el" href="../../da/d35/classcv_1_1Range.html" title="Template class specifying a continuous subsequence (slice) of a sequence. ">Range</a> (0..1]. </td></tr>
    <tr><td class="paramname">_sigma_scale</td><td>Sigma for Gaussian filter. It is computed as sigma = _sigma_scale/_scale. </td></tr>
    <tr><td class="paramname">_quant</td><td>Bound to the quantization error on the gradient norm. </td></tr>
    <tr><td class="paramname">_ang_th</td><td>Gradient angle tolerance in degrees. </td></tr>
    <tr><td class="paramname">_log_eps</td><td>Detection threshold: -log10(NFA) &gt; log_eps. Used only when advance refinement is chosen. </td></tr>
    <tr><td class="paramname">_density_th</td><td>Minimal density of aligned region points in the enclosing rectangle. </td></tr>
    <tr><td class="paramname">_n_bins</td><td>Number of bins in pseudo-ordering of gradient modulus.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Implementation has been removed due original code license conflict </dd></dl>
</div>
</div>
<a id="ga1d6bb77486c8f92d79c8793ad995d541"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1d6bb77486c8f92d79c8793ad995d541">◆ </a></span>goodFeaturesToTrack() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::goodFeaturesToTrack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>corners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxCorners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>qualityLevel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minDistance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>useHarrisDetector</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>k</em> = <code>0.04</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners, cornersQuality</td><td>=</td><td>cv.goodFeaturesToTrackWithQuality(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Determines strong corners on an image. </p>
<p>The function finds the most prominent corners in the image or in the specified image region, as described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Shi94">[223]</a></p>
<ul>
<li>Function calculates the corner quality measure at every source image pixel using the <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a> or <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a> .</li>
<li>Function performs a non-maximum suppression (the local maximums in <em>3 x 3</em> neighborhood are retained).</li>
<li>The corners with the minimal eigenvalue less than \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) are rejected.</li>
<li>The remaining corners are sorted by the quality measure in the descending order.</li>
<li>Function throws away each corner for which there is a stronger corner at a distance less than maxDistance.</li>
</ul>
<p>The function can be used to initialize a point-based tracker of an object.</p>
<dl class="section note"><dt>Note</dt><dd>If the function is called with different values A and B of the parameter qualityLevel , and A &gt; B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>Input 8-bit or floating-point 32-bit, single-channel image. </td></tr>
    <tr><td class="paramname">corners</td><td>Output vector of detected corners. </td></tr>
    <tr><td class="paramname">maxCorners</td><td>Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned. <code>maxCorners &lt;= 0</code> implies that no limit on the maximum is set and all detected corners are returned. </td></tr>
    <tr><td class="paramname">qualityLevel</td><td>Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a> ) or the Harris function response (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a> ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected. </td></tr>
    <tr><td class="paramname">minDistance</td><td>Minimum possible Euclidean distance between the returned corners. </td></tr>
    <tr><td class="paramname">mask</td><td>Optional region of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected. </td></tr>
    <tr><td class="paramname">blockSize</td><td>Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs . </td></tr>
    <tr><td class="paramname">useHarrisDetector</td><td>Parameter indicating whether to use a Harris detector (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a>) or <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a>. </td></tr>
    <tr><td class="paramname">k</td><td>Free parameter of the Harris detector.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a>, <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a>, <a class="el" href="../../dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323" title="Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyra...">calcOpticalFlowPyrLK</a>, <a class="el" href="../../dc/d6b/group__video__track.html#ga762cbe5efd52cf078950196f3c616d48" title="Computes an optimal affine transformation between two 2D point sets. ">estimateRigidTransform</a>, </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d2/d1d/samples_2cpp_2lkdemo_8cpp-example.html#a20">samples/cpp/lkdemo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gaaf8a051fb13cab1eba5e2149f75e902f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf8a051fb13cab1eba5e2149f75e902f">◆ </a></span>goodFeaturesToTrack() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::goodFeaturesToTrack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>corners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxCorners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>qualityLevel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minDistance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>gradientSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>useHarrisDetector</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>k</em> = <code>0.04</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners, cornersQuality</td><td>=</td><td>cv.goodFeaturesToTrackWithQuality(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
</div>
</div>
<a id="gac52aa0fc91b1fd4a5f5a8c7d80e04bd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac52aa0fc91b1fd4a5f5a8c7d80e04bd4">◆ </a></span>goodFeaturesToTrack() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::goodFeaturesToTrack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>corners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxCorners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>qualityLevel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minDistance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>cornersQuality</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>gradientSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>useHarrisDetector</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>k</em> = <code>0.04</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners</td><td>=</td><td>cv.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>corners, cornersQuality</td><td>=</td><td>cv.goodFeaturesToTrackWithQuality(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance, mask[, corners[, cornersQuality[, blockSize[, gradientSize[, useHarrisDetector[, k]]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Same as above, but returns also quality measure of the detected corners. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>Input 8-bit or floating-point 32-bit, single-channel image. </td></tr>
    <tr><td class="paramname">corners</td><td>Output vector of detected corners. </td></tr>
    <tr><td class="paramname">maxCorners</td><td>Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned. <code>maxCorners &lt;= 0</code> implies that no limit on the maximum is set and all detected corners are returned. </td></tr>
    <tr><td class="paramname">qualityLevel</td><td>Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a> ) or the Harris function response (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a> ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected. </td></tr>
    <tr><td class="paramname">minDistance</td><td>Minimum possible Euclidean distance between the returned corners. </td></tr>
    <tr><td class="paramname">mask</td><td>Region of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected. </td></tr>
    <tr><td class="paramname">cornersQuality</td><td>Output vector of quality measure of the detected corners. </td></tr>
    <tr><td class="paramname">blockSize</td><td>Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs . </td></tr>
    <tr><td class="paramname">gradientSize</td><td>Aperture parameter for the Sobel operator used for derivatives computation. See cornerEigenValsAndVecs . </td></tr>
    <tr><td class="paramname">useHarrisDetector</td><td>Parameter indicating whether to use a Harris detector (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a>) or <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a>. </td></tr>
    <tr><td class="paramname">k</td><td>Free parameter of the Harris detector. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga47849c3be0d0406ad3ca45db65a25d2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga47849c3be0d0406ad3ca45db65a25d2d">◆ </a></span>HoughCircles()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::HoughCircles </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>circles</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>dp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minDist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>param1</em> = <code>100</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>param2</em> = <code>100</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>minRadius</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxRadius</em> = <code>0</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>circles</td><td>=</td><td>cv.HoughCircles(</td><td class="paramname">image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Finds circles in a grayscale image using the Hough transform. </p>
<p>The function finds circles in a grayscale image using a modification of the Hough transform.</p>
<p>Example: : </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;math.h&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d8/dcc/namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div><div class="line">{</div><div class="line">    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> img, gray;</div><div class="line">    <span class="keywordflow">if</span>( argc != 2 || !(img=<a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>(argv[1], 1)).data)</div><div class="line">        <span class="keywordflow">return</span> -1;</div><div class="line">    <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab">cvtColor</a>(img, gray, <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#gga4e0972be5de079fed4e3a10e24ef5ef0a353a4b8db9040165db4dacb5bcefb6ea">COLOR_BGR2GRAY</a>);</div><div class="line">    <span class="comment">// smooth it, otherwise a lot of false circles may be detected</span></div><div class="line">    <a class="code" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1">GaussianBlur</a>( gray, gray, <a class="code" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(9, 9), 2, 2 );</div><div class="line">    vector&lt;Vec3f&gt; circles;</div><div class="line">    <a class="code" href="../../dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d">HoughCircles</a>(gray, circles, <a class="code" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d">HOUGH_GRADIENT</a>,</div><div class="line">                 2, gray.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#abed816466c45234254d25bc59c31245e">rows</a>/4, 200, 100 );</div><div class="line">    <span class="keywordflow">for</span>( <span class="keywordtype">size_t</span> i = 0; i &lt; circles.size(); i++ )</div><div class="line">    {</div><div class="line">         <a class="code" href="../../db/d4e/classcv_1_1Point__.html">Point</a> center(<a class="code" href="../../db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85">cvRound</a>(circles[i][0]), <a class="code" href="../../db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85">cvRound</a>(circles[i][1]));</div><div class="line">         <span class="keywordtype">int</span> radius = <a class="code" href="../../db/de0/group__core__utils.html#ga085eca238176984a0b72df2818598d85">cvRound</a>(circles[i][2]);</div><div class="line">         <span class="comment">// draw the circle center</span></div><div class="line">         <a class="code" href="../../d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670">circle</a>( img, center, 3, <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(0,255,0), -1, 8, 0 );</div><div class="line">         <span class="comment">// draw the circle outline</span></div><div class="line">         <a class="code" href="../../d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670">circle</a>( img, center, radius, <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(0,0,255), 3, 8, 0 );</div><div class="line">    }</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b">namedWindow</a>( <span class="stringliteral">"circles"</span>, 1 );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">"circles"</span>, img );</div><div class="line"></div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>(0);</div><div class="line">    <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d" title="basically 21HT, described in  ">HOUGH_GRADIENT</a> method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure.</dd></dl>
<p>It also helps to smooth image a bit unless it's already soft. For example, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur()</a> with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>8-bit, single-channel, grayscale input image. </td></tr>
    <tr><td class="paramname">circles</td><td>Output vector of found circles. Each vector is encoded as 3 or 4 element floating-point vector \((x, y, radius)\) or \((x, y, radius, votes)\) . </td></tr>
    <tr><td class="paramname">method</td><td>Detection method, see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga073687a5b96ac7a3ab5802eb5510fe65" title="Variants of a Hough transform. ">HoughModes</a>. The available methods are <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d" title="basically 21HT, described in  ">HOUGH_GRADIENT</a> and <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a>. </td></tr>
    <tr><td class="paramname">dp</td><td>Inverse ratio of the accumulator resolution to the image resolution. For example, if dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has half as big width and height. For <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a> the recommended value is dp=1.5, unless some small very circles need to be detected. </td></tr>
    <tr><td class="paramname">minDist</td><td>Minimum distance between the centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </td></tr>
    <tr><td class="paramname">param1</td><td>First method-specific parameter. In case of <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d" title="basically 21HT, described in  ">HOUGH_GRADIENT</a> and <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a>, it is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller). Note that <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a> uses <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9" title="Calculates the first x- or y- image derivative using Scharr operator. ">Scharr</a> algorithm to compute image derivatives, so the threshold value shough normally be higher, such as 300 or normally exposed and contrasty images. </td></tr>
    <tr><td class="paramname">param2</td><td>Second method-specific parameter. In case of <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d" title="basically 21HT, described in  ">HOUGH_GRADIENT</a>, it is the accumulator threshold for the circle centers at the detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. In the case of <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a> algorithm, this is the circle "perfectness" measure. The closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine. If you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less. But then also try to limit the search range [minRadius, maxRadius] to avoid many false circles. </td></tr>
    <tr><td class="paramname">minRadius</td><td>Minimum circle radius. </td></tr>
    <tr><td class="paramname">maxRadius</td><td>Maximum circle radius. If &lt;= 0, uses the maximum image dimension. If &lt; 0, <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65ab1bf00a90864db34b2f72fa76389931d" title="basically 21HT, described in  ">HOUGH_GRADIENT</a> returns centers without finding the radius. <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gga073687a5b96ac7a3ab5802eb5510fe65aad57c72131c801de427f1fdb55c8c8ad" title="variation of HOUGH_GRADIENT to get better accuracy ">HOUGH_GRADIENT_ALT</a> always computes circle radiuses.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d3/dc0/group__imgproc__shape.html#gaf259efaad93098103d6c27b9e4900ffa" title="Fits an ellipse around a set of 2D points. ">fitEllipse</a>, <a class="el" href="../../d3/dc0/group__imgproc__shape.html#ga8ce13c24081bbc7151e9326f412190f1" title="Finds a circle of the minimum area enclosing a 2D point set. ">minEnclosingCircle</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/de6/samples_2cpp_2tutorial_code_2ImgTrans_2houghcircles_8cpp-example.html#a8">samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga46b4e588934f6c8dfd509cc6e0e4545a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga46b4e588934f6c8dfd509cc6e0e4545a">◆ </a></span>HoughLines()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::HoughLines </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>lines</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>rho</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>threshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>srn</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>stn</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>min_theta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>max_theta</em> = <code><a class="el" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>lines</td><td>=</td><td>cv.HoughLines(</td><td class="paramname">image, rho, theta, threshold[, lines[, srn[, stn[, min_theta[, max_theta]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Finds lines in a binary image using the standard Hough transform. </p>
<p>The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm">http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm</a> for a good explanation of Hough transform.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>8-bit, single-channel binary source image. The image may be modified by the function. </td></tr>
    <tr><td class="paramname">lines</td><td>Output vector of lines. Each line is represented by a 2 or 3 element vector \((\rho, \theta)\) or \((\rho, \theta, \textrm{votes})\) . \(\rho\) is the distance from the coordinate origin \((0,0)\) (top-left corner of the image). \(\theta\) is the line rotation angle in radians ( \(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\) ). \(\textrm{votes}\) is the value of accumulator. </td></tr>
    <tr><td class="paramname">rho</td><td>Distance resolution of the accumulator in pixels. </td></tr>
    <tr><td class="paramname">theta</td><td>Angle resolution of the accumulator in radians. </td></tr>
    <tr><td class="paramname">threshold</td><td><a class="el" href="../../d0/d9e/structcv_1_1Accumulator.html">Accumulator</a> threshold parameter. Only those lines are returned that get enough votes ( \(&gt;\texttt{threshold}\) ). </td></tr>
    <tr><td class="paramname">srn</td><td>For the multi-scale Hough transform, it is a divisor for the distance resolution rho . The coarse accumulator distance resolution is rho and the accurate accumulator resolution is rho/srn . If both srn=0 and stn=0 , the classical Hough transform is used. Otherwise, both these parameters should be positive. </td></tr>
    <tr><td class="paramname">stn</td><td>For the multi-scale Hough transform, it is a divisor for the distance resolution theta. </td></tr>
    <tr><td class="paramname">min_theta</td><td>For standard and multi-scale Hough transform, minimum angle to check for lines. Must fall between 0 and max_theta. </td></tr>
    <tr><td class="paramname">max_theta</td><td>For standard and multi-scale Hough transform, maximum angle to check for lines. Must fall between min_theta and CV_PI. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df9/samples_2cpp_2tutorial_code_2ImgTrans_2houghlines_8cpp-example.html#a9">samples/cpp/tutorial_code/ImgTrans/houghlines.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga8618180a5948286384e3b7ca02f6feeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8618180a5948286384e3b7ca02f6feeb">◆ </a></span>HoughLinesP()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::HoughLinesP </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>lines</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>rho</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>threshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minLineLength</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>maxLineGap</em> = <code>0</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>lines</td><td>=</td><td>cv.HoughLinesP(</td><td class="paramname">image, rho, theta, threshold[, lines[, minLineLength[, maxLineGap]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Finds line segments in a binary image using the probabilistic Hough transform. </p>
<p>The function implements the probabilistic Hough transform algorithm for line detection, described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Matas00">[165]</a></p>
<p>See the line detection example below: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d4/dd5/highgui_8hpp.html">opencv2/highgui.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d8/dcc/namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)</div><div class="line">{</div><div class="line">    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> src, dst, color_dst;</div><div class="line">    <span class="keywordflow">if</span>( argc != 2 || !(src=<a class="code" href="../../d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56">imread</a>(argv[1], 0)).data)</div><div class="line">        <span class="keywordflow">return</span> -1;</div><div class="line"></div><div class="line">    <a class="code" href="../../dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de">Canny</a>( src, dst, 50, 200, 3 );</div><div class="line">    <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab">cvtColor</a>( dst, color_dst, <a class="code" href="../../d8/d01/group__imgproc__color__conversions.html#gga4e0972be5de079fed4e3a10e24ef5ef0a869da65c045477f2f17d39395df65b2d">COLOR_GRAY2BGR</a> );</div><div class="line"></div><div class="line">    vector&lt;Vec4i&gt; lines;</div><div class="line">    <a class="code" href="../../dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb">HoughLinesP</a>( dst, lines, 1, <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>/180, 80, 30, 10 );</div><div class="line">    <span class="keywordflow">for</span>( <span class="keywordtype">size_t</span> i = 0; i &lt; lines.size(); i++ )</div><div class="line">    {</div><div class="line">        <a class="code" href="../../d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2">line</a>( color_dst, <a class="code" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(lines[i][0], lines[i][1]),</div><div class="line">        <a class="code" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>( lines[i][2], lines[i][3]), <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(0,0,255), 3, 8 );</div><div class="line">    }</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b">namedWindow</a>( <span class="stringliteral">"Source"</span>, 1 );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">"Source"</span>, src );</div><div class="line"></div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b">namedWindow</a>( <span class="stringliteral">"Detected Lines"</span>, 1 );</div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">imshow</a>( <span class="stringliteral">"Detected Lines"</span>, color_dst );</div><div class="line"></div><div class="line">    <a class="code" href="../../d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7">waitKey</a>(0);</div><div class="line">    <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --><p> This is a sample picture the function parameters have been tuned for:</p>
<div class="image">
<img alt="building.jpg" src="../../building.jpg"/>
<div class="caption">
image</div></div>
<p> And this is the output of the above program in case of the probabilistic Hough transform:</p>
<div class="image">
<img alt="houghp.png" src="../../houghp.png"/>
<div class="caption">
image</div></div>
 <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>8-bit, single-channel binary source image. The image may be modified by the function. </td></tr>
    <tr><td class="paramname">lines</td><td>Output vector of lines. Each line is represented by a 4-element vector \((x_1, y_1, x_2, y_2)\) , where \((x_1,y_1)\) and \((x_2, y_2)\) are the ending points of each detected line segment. </td></tr>
    <tr><td class="paramname">rho</td><td>Distance resolution of the accumulator in pixels. </td></tr>
    <tr><td class="paramname">theta</td><td>Angle resolution of the accumulator in radians. </td></tr>
    <tr><td class="paramname">threshold</td><td><a class="el" href="../../d0/d9e/structcv_1_1Accumulator.html">Accumulator</a> threshold parameter. Only those lines are returned that get enough votes ( \(&gt;\texttt{threshold}\) ). </td></tr>
    <tr><td class="paramname">minLineLength</td><td>Minimum line length. Line segments shorter than that are rejected. </td></tr>
    <tr><td class="paramname">maxLineGap</td><td>Maximum allowed gap between points on the same line to link them.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../db/d73/classcv_1_1LineSegmentDetector.html" title="Line segment detector class. ">LineSegmentDetector</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/df9/samples_2cpp_2tutorial_code_2ImgTrans_2houghlines_8cpp-example.html#a20">samples/cpp/tutorial_code/ImgTrans/houghlines.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga2858ef61b4e47d1919facac2152a160e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2858ef61b4e47d1919facac2152a160e">◆ </a></span>HoughLinesPointSet()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::HoughLinesPointSet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>_point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>_lines</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>lines_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>threshold</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>min_rho</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>max_rho</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>rho_step</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>min_theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>max_theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>theta_step</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>_lines</td><td>=</td><td>cv.HoughLinesPointSet(</td><td class="paramname">_point, lines_max, threshold, min_rho, max_rho, rho_step, min_theta, max_theta, theta_step[, _lines]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Finds lines in a set of points using the standard Hough transform. </p>
<p>The function finds lines in a set of points using a modification of the Hough transform. </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d0/d9c/core_2include_2opencv2_2core_8hpp.html">opencv2/core.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d8/dcc/namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">    <a class="code" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> lines;</div><div class="line">    vector&lt;Vec3d&gt; line3d;</div><div class="line">    vector&lt;Point2f&gt; point;</div><div class="line">    <span class="keyword">const</span> <span class="keyword">static</span> <span class="keywordtype">float</span> Points[20][2] = {</div><div class="line">    { 0.0f,   369.0f }, { 10.0f,  364.0f }, { 20.0f,  358.0f }, { 30.0f,  352.0f },</div><div class="line">    { 40.0f,  346.0f }, { 50.0f,  341.0f }, { 60.0f,  335.0f }, { 70.0f,  329.0f },</div><div class="line">    { 80.0f,  323.0f }, { 90.0f,  318.0f }, { 100.0f, 312.0f }, { 110.0f, 306.0f },</div><div class="line">    { 120.0f, 300.0f }, { 130.0f, 295.0f }, { 140.0f, 289.0f }, { 150.0f, 284.0f },</div><div class="line">    { 160.0f, 277.0f }, { 170.0f, 271.0f }, { 180.0f, 266.0f }, { 190.0f, 260.0f }</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 20; i++)</div><div class="line">    {</div><div class="line">        point.push_back(<a class="code" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a>(Points[i][0],Points[i][1]));</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keywordtype">double</span> rhoMin = 0.0f, rhoMax = 360.0f, rhoStep = 1;</div><div class="line">    <span class="keywordtype">double</span> thetaMin = 0.0f, thetaMax = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a> / 2.0f, thetaStep = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a> / 180.0f;</div><div class="line"></div><div class="line">    <a class="code" href="../../dd/d1a/group__imgproc__feature.html#ga2858ef61b4e47d1919facac2152a160e">HoughLinesPointSet</a>(point, lines, 20, 1,</div><div class="line">                       rhoMin, rhoMax, rhoStep,</div><div class="line">                       thetaMin, thetaMax, thetaStep);</div><div class="line"></div><div class="line">    lines.<a class="code" href="../../d3/d63/classcv_1_1Mat.html#a33fd5d125b4c302b0c9aa86980791a77">copyTo</a>(line3d);</div><div class="line">    printf(<span class="stringliteral">"votes:%d, rho:%.7f, theta:%.7f\n"</span>,(<span class="keywordtype">int</span>)line3d.at(0).val[0], line3d.at(0).val[1], line3d.at(0).val[2]);</div><div class="line">}</div></div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">_point</td><td>Input vector of points. Each vector must be encoded as a Point vector \((x,y)\). Type must be CV_32FC2 or CV_32SC2. </td></tr>
    <tr><td class="paramname">_lines</td><td>Output vector of found lines. Each vector is encoded as a vector&lt;Vec3d&gt; \((votes, rho, theta)\). The larger the value of 'votes', the higher the reliability of the Hough line. </td></tr>
    <tr><td class="paramname">lines_max</td><td>Max count of hough lines. </td></tr>
    <tr><td class="paramname">threshold</td><td><a class="el" href="../../d0/d9e/structcv_1_1Accumulator.html">Accumulator</a> threshold parameter. Only those lines are returned that get enough votes ( \(&gt;\texttt{threshold}\) ) </td></tr>
    <tr><td class="paramname">min_rho</td><td>Minimum Distance value of the accumulator in pixels. </td></tr>
    <tr><td class="paramname">max_rho</td><td>Maximum Distance value of the accumulator in pixels. </td></tr>
    <tr><td class="paramname">rho_step</td><td>Distance resolution of the accumulator in pixels. </td></tr>
    <tr><td class="paramname">min_theta</td><td>Minimum angle value of the accumulator in radians. </td></tr>
    <tr><td class="paramname">max_theta</td><td>Maximum angle value of the accumulator in radians. </td></tr>
    <tr><td class="paramname">theta_step</td><td>Angle resolution of the accumulator in radians. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gaa819f39b5c994871774081803ae22586"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa819f39b5c994871774081803ae22586">◆ </a></span>preCornerDetect()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::preCornerDetect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.preCornerDetect(</td><td class="paramname">src, ksize[, dst[, borderType]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates a feature map for corner detection. </p>
<p>The function calculates the complex spatial derivative-based function of the source image</p>
<p class="formulaDsp">
\[\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}\]
</p>
<p>where \(D_x\), \(D_y\) are the first image derivatives, \(D_{xx}\), \(D_{yy}\) are the second image derivatives, and \(D_{xy}\) is the mixed derivative.</p>
<p>The corners can be found as local maximums of the functions, as shown below: </p><div class="fragment"><div class="line">Mat corners, dilated_corners;</div><div class="line"><a class="code" href="../../dd/d1a/group__imgproc__feature.html#gaa819f39b5c994871774081803ae22586">preCornerDetect</a>(image, corners, 3);</div><div class="line"><span class="comment">// dilation with 3x3 rectangular structuring element</span></div><div class="line"><a class="code" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c">dilate</a>(corners, dilated_corners, Mat(), 1);</div><div class="line">Mat corner_mask = corners == dilated_corners;</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source single-channel 8-bit of floating-point image. </td></tr>
    <tr><td class="paramname">dst</td><td>Output image that has the type CV_32F and the same size as src . </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture size of the Sobel . </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method. See <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:40 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
